package com.jvm.oom.test.model;

import cn.hutool.core.util.RandomUtil;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

/**
 * Model Object
 *
 * @author likeguo
 */
@Data
@Builder
@AllArgsConstructor
public class ModelObject {

    private Integer id;

    private String name;

    private Byte[] bytes;

    public ModelObject() {
        id = RandomUtil.randomInt();
        name = RandomUtil.randomNumbers(10);
        bytes = new Byte[RandomUtil.randomInt(99) + 1];
    }

    public static ModelObject bigObject() {
        ModelObject object = new ModelObject();
        object.setBytes(new Byte[1024 * 1024 * 3]);
        return object;
    }
}
